.chat-area {
    &__file-previews {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 8px;
        max-height: calc((40px + 24px + 16px) * 3 + 16px); // 3行文件的高度（文件高度+padding+gap）+ 底部间距
        overflow-y: auto;
        padding-right: 8px; // 为滚动条预留空间

        /* 自定义滚动条样式 */
        &::-webkit-scrollbar {
            width: 4px;
        }

        &::-webkit-scrollbar-track {
            background: transparent;
        }

        &::-webkit-scrollbar-thumb {
            background: #E5E6E8;
            border-radius: 2px;
        }

        &::-webkit-scrollbar-thumb:hover {
            background: #C9CDD4;
        }
    }

    &__file-preview {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 12px;

        background: #F7F8FA;
        border-radius: 8px;
        border: 1px solid #E5E6E8;
        width: 230px;
        min-width: 230px;
        transition: background 0.3s ease;
        position: relative;
    }

    &__file-content {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 40px;
    }

    &__file-icon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border-radius: 4px;
        overflow: hidden;

        img {
            width: 100%;
            height: 100%;

            object-fit: contain;
        }

        &--image {
            img {
                object-fit: cover;
            }
        }
    }

    &__file-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
    }

    &__file-title {
        font-size: 14px;
        color: #1D2129;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 20px;
    }

    &__file-size {
        font-size: 12px;
        color: #86909C;
        display: flex;
        align-items: center;
        gap: 4px;
        line-height: 17px;

        &--error {
            color: #F53F3F;

            i {
                color: #F53F3F;
                font-size: 14px;
            }
        }
    }

    &__remove-file {
        width: 14px;
        height: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        background: #1D2129;
        color: #FFFFFF;
        cursor: pointer;
        border-radius: 50%;
        position: absolute;
        top: 0;
        right: 0;
        z-index: 1;

        &:hover {
            background: #4E5969;
        }

        i {
            font-size: 10px;
        }
    }
}